<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('welcome');
});

// 帕克西官网路由组 首页、核心技术、产品、视频、案例、企业动态、关于我们
Route::group(['middleware'=>'lang'], function () {

    // 首页
    Route::get('/', ['as' => 'home', function () {
        return view("official_website.home");
    }]);

    // 核心技术组
    Route::group(['prefix' => 'technology'], function(){

        // 3d 眼镜试戴
        Route::get('3d_glass_try_on', ['as'=>'3d_glass_try_on' ,function () {
            return view("official_website.technology.3d_glass_try_on");
        }]);
        
        // ar游戏
        Route::get('ar_game', ['as'=>'ar_game' ,function () {
            return view("official_website.technology.ar_game");
        }]);

        // 360 环视
        Route::get('360_roved',['as' => '360_roved', function () {
            return view('official_website.technology.360_roved');
        }]);

        // 脸部表情识别
        Route::get('facial_expression_recognition', ['as' => 'facial_expression_recognition', function () {
            return view('official_website.technology.facial_expression_recognition');
        }]);

         // 互动投影
        Route::get('interactive_projection', ['as' => 'interactive_projection', function () {
            return view('official_website.technology.interactive_projection');
        }]);

        // 脸型识别
        Route::get('face_recognition', ['as' => 'face_recognition', function () {
            return view('official_website.technology.face_recognition');
        }]);
        
        // 试戴美瞳
        route::get('try_on_contact_lenses', ['as'=>'try_on_contact_lenses', function () {
            return view('official_website.technology.try_on_contact_lenses');
        }]);

        // 人脸检测
        route::get('face_detection',['as'=>'face_detection', function () {
            return view('official_website.technology.face_detection');
        }]);
        
        // 人脸老化
        route::get('face_aging',['as'=>'face_aging', function () {
            return view('official_website.technology.face_aging');
        }]);

        // 脸部重建
        route::get('face_reconstruction',['as'=>'face_reconstruction', function () {
            return view('official_website.technology.face_reconstruction');
        }]);

        // 人物照片合成
        route::get('photomontage',['as'=>'photomontage', function (){
            return view('official_website.technology.photomontage');
        }]);

        //  视线追踪
        route::get('eye_tracking',['as'=>'eye_tracking', function () {
            return view('official_website.technology.eye_tracking');
        }]);

        // 手势互动
        route::get('gesture_interaction', ['as'=>'gesture_interaction', function () {
            return view('official_website.technology.gesture_interaction');
        }]);

         // 手势识别
         route::get('gesture_recognition', ['as'=>'gesture_recognition', function () {
            return view('official_website.technology.gesture_recognition');
        }]);

        // 分割头发
        route::get('split_hair', ['as'=>'split_hair', function () {
            return view('official_website.technology.split_hair');
        }]);

        // 肢体捕捉
        route::get('motion_captures',['as'=>'motion_captures', function () {
            return view('official_website.technology.motion_captures');
        }]);

        // 肢体追踪
        route::get('limbs_tracking',['as'=>'limbs_tracking', function () {
            return view('official_website.technology.limbs_tracking');
        }]);

        // ----------------  新添加 --------------------//
        // 2.5d眼镜试戴
        route::get('2.5d_glass_try_on', ['as' => '25d_glass_try_on', function () {
            return view('official_website.technology.25d_glass_try_on');
        }]);

        // 2D发型试戴
        route::get('2d_hairdo_try_on', ['as' => '2d_hairdo_try_on', function () {
            return view('official_website.technology.2d_hairdo_try_on');
        }]);

        // 3d 发型试戴
        route::get('3d_hairdo_try_on', ['as' => '3d_hairdo_try_on', function () {
            return view('official_website.technology.3d_hairdo_try_on');
        }]);

        // ar 试妆
        route::get('ar_makeup_try_on', ['as' => 'ar_makeup_try_on', function () {
            return view('official_website.technology.ar_makeup_try_on');
        }]);

        // 魔妆镜
        route::get('magic_mirror', ['as' => 'magic_mirror', function () {
            return view('official_website.technology.magic_mirror');
        }]);

        // 变脸
        route::get('face_changing', ['as' => 'face_changing', function () {
            return view('official_website.technology.face_changing');
        }]);

        // 脸部数据采集
        route::get('facial_data_acquisition', ['as' => 'facial_data_acquisition', function () {
            return view('official_website.technology.facial_data_acquisition');
        }]);

        // 面部动作追踪
        route::get('facial_motion_tracking', ['as' => 'facial_motion_tracking', function () {
             return view('official_website.technology.facial_motion_tracking');
        }]);

        // 美妆镜
        route::get('beauty_mirror', ['as' => 'beauty_mirror', function () {
            return view('official_website.technology.beauty_mirror');
        }]);

    });

    // 产品
    Route::get('/production', ['as'=>'production' ,function () {
        return view("official_website.production");
    }]);

    // 视频专区
    Route::get('/video', ['as'=>'video' ,function () {
        return view("official_website.video");
    }]);

    // 视频专区
    Route::get('/product', ['as'=>'product' ,function () {
        return view("official_website.product");
    }]);

    // 企业动态
    Route::get('/news', ['as'=>'news' ,function () {
        return view("official_website.news");
    }]);


    // 关于我们
    Route::get('/about', [ 'as'=>'about' ,function () {
        return view("official_website.about");
    }]);

    // 新闻详情
    Route::get('/news/{articleId}',['as'=>'news_detail',function ($articleId) {
        return view("official_website.news_detail",['articleId'=>$articleId]);
    }]);

    Route::get('/case', [ 'as'=>'case' ,function () {
        return view("official_website.case");
    }]);

    // 404
    Route::get(
        '/**',
        [
            'as' => '404',
             function () {
                return view("error.404");
            }
        ]
    );

});


// 管理后台
Route::group([], function () {

    Route::get('admin-web/login', ['as'=>'web-login','uses'=>'Auth\WebAuthController@webLogin']);
    Route::post('admin-web/login', ['as'=>'web-login','uses'=>'Auth\WebAuthController@webLoginPost']);
    Route::get('web-logout', ['as'=>'web-logout','uses'=>'Auth\WebAuthController@webLogout']);

    Route::get('bym_news','WebPage\ArticleController@articleList');
    Route::get('bym_article/{id}','WebPage\ArticleController@articleDetail');

    Route::get('admin/index',['as'=>'web-home','uses'=>'Admin\HomeController@webIndex']);

    Route::group(['prefix'=>'admin','namespace'=>'WebPage\Admin','middleware'=>['auth:web-admin']],function () {

        Route::resource('news/edit_news','ArticleController');

        Route::resource('news/type-tag','ArticleTypeController');

        Route::resource('video/web-video','VideoController');

        /**
         * @uses \App\Http\Controllers\WebPage\Admin\CaseController
         */
        Route::resource('case','CaseController');

        Route::resource('feedback','FeedbackController');

        Route::post('news/article/uploadimg','ArticleController@uploadArticleImg');
    });
});
